/*
    日志等级模块
    通过日志等级来判断程序的健康状况
    并且可以通过该模块，实现特定等级日志的不可见性
    1.枚举类——日志等级
    2.将日志等级转换为字符串
*/

#pragma once
namespace logging
{
    class logLevel
    {
    public:
        enum class value
        {
            UNKNOWN = 0,
            DEBUG,
            INFO,
            WARNNING,
            ERROR,
            FATAL,
            OFF
        };

        static const char *toString(logging::logLevel::value v)
        {
            switch (v)
            {
            case logging::logLevel::value::DEBUG:
                return "DEBUG";
            case logging::logLevel::value::INFO:
                return "INFO";
            case logging::logLevel::value::WARNNING:
                return "WARNNING";
            case logging::logLevel::value::ERROR:
                return "ERROR";
            case logging::logLevel::value::FATAL:
                return "FATAL";
            }
            return "UNKNOWN";
        }
    };
}